import React from 'react'

function MessageErr (props) {
  const { errors } = props;
  if (!errors) {
    return null
  }
  return (
    <ul className="error-messages">
      {Object.keys(errors).map(key => (
        <li key={key}>{key}{errors[key]}</li>
      ))}
    </ul>
  )
}

export default MessageErr